package com.ruoyi.car.service.impl;

import java.util.List;

import com.ruoyi.car.vo.ListAndUserVO;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.car.mapper.TmdCarListMapper;
import com.ruoyi.car.domain.TmdCarList;
import com.ruoyi.car.service.ITmdCarListService;
import com.ruoyi.common.core.text.Convert;

/**
 * 车辆信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-19
 */
@Service
public class TmdCarListServiceImpl implements ITmdCarListService 
{
    @Autowired
    private TmdCarListMapper tmdCarListMapper;


    /**
     * 查询车辆信息
     * 
     * @param id 车辆信息主键
     * @return 车辆信息
     */
    @Override
    public ListAndUserVO selectTmdCarListById(Long id)
    {
        return tmdCarListMapper.selectTmdCarListById(id);
    }

    /**
     * 查询车辆信息列表
     * 
     * @param tmdCarList 车辆信息
     * @return 车辆信息
     */
    @Override
    public List<TmdCarList> selectTmdCarListList(TmdCarList tmdCarList)
    {
        return tmdCarListMapper.selectTmdCarListList(tmdCarList);
    }

    /**
     * 新增车辆信息
     * 
     * @param tmdCarList 车辆信息
     * @return 结果
     */
    @Override
    public int insertTmdCarList(TmdCarList tmdCarList)
    {
        tmdCarList.setCreateTime(DateUtils.getNowDate());
        return tmdCarListMapper.insertTmdCarList(tmdCarList);
    }

    /**
     * 修改车辆信息
     * 
     * @param tmdCarList 车辆信息
     * @return 结果
     */
    @Override
    public int updateTmdCarList(TmdCarList tmdCarList)
    {
        return tmdCarListMapper.updateTmdCarList(tmdCarList);
    }

    /**
     * 批量删除车辆信息
     * 
     * @param ids 需要删除的车辆信息主键
     * @return 结果
     */
    @Override
    public int deleteTmdCarListByIds(String ids)
    {
        return tmdCarListMapper.deleteTmdCarListByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除车辆信息信息
     * 
     * @param id 车辆信息主键
     * @return 结果
     */
    @Override
    public int deleteTmdCarListById(Long id)
    {
        return tmdCarListMapper.deleteTmdCarListById(id);
    }

    @Override
    public List<SysUser> getAllUsers() {
        return tmdCarListMapper.getAllUsers();
    }


    @Override
    public TmdCarList getCarInfo(int carId) {
        return tmdCarListMapper.getCarInfo(carId);
    }

    @Override
    public List<Integer> getAllCarStatus() {
        return tmdCarListMapper.getAllCarStatus();
    }


    @Override
    public int updateCarStatus(Long carId) {
        return tmdCarListMapper.updateCarStatus(carId);
    }
}
